﻿Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports Seuss.EnterpriseLibrary.DataAccess
Imports Seuss.EnterpriseLibrary.BusinessLogic
Imports System.Collections.Generic
Imports System.Data.SqlClient
Imports System.Data
Imports System.Web

Partial Class Consulta_Padre
    Inherits System.Web.UI.Page


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Response.Expires = -1
        Response.AddHeader("Pragma", "no-cache")
        Response.AddHeader("cache-control", "private")
        Response.CacheControl = "no-cache"
        If Not Page.IsPostBack Then
            Call CargarParientes()
            Using Seguridad As New BLL_Administracion
                Seguridad.Set_Transaccion_Insert(Nothing, 100401, IdentityUser.UserCode, My.Request.UserHostAddress.ToString, CrearXMLTransaccion("Consulta Pagina Movil", "/Pagina|" + My.Request.Url.Segments(My.Request.Url.Segments.Length - 1).ToString))
            End Using
        End If
    End Sub

    Private Sub CargarParientes()
        Dim ldr As New List(Of IDataReader)
        Dim DivPrincipal As New StringBuilder
        
        DivPrincipal.Append("<table border=0 style='width:100%;'>")

        Using ObjPool As New PoolDbCommand()
            Dim ObjUsuario As New DAL_Kiosco(ObjPool.Database)
            ObjPool.AddDbCommand(ObjUsuario.Get_Familiares_By_Padre(IdentityUser.UserCode), PoolDbCommand.PoolDbCommandResultType.Query)
            ObjPool.Pooling(Nothing, ldr, True)
            ObjUsuario = Nothing
            While ldr(0).Read
                DivPrincipal.Append("<tr>")
                DivPrincipal.Append("   <td style='font-size:8px;width:15%;'><img src='../Imagenes/PerImagen.aspx?Width=64&Height=72&cPerCodigo=" + ldr(0).Item("cpercodigo").ToString + "'></td>")
                DivPrincipal.Append("   <td style='font-size:8px;width:45%;'>")
                DivPrincipal.Append("       <table>")
                DivPrincipal.Append("           <tr><td style='font-size:8px;text-align:left'><span style='font-size: 8pt; font-weight: 700; color: #184E72;'>" + ldr(0).Item("nombres").ToString + "</span></td></tr>")
                DivPrincipal.Append("           <tr><td style='font-size:8px;text-align:left'><span style='font-weight: 700; color: #1A6696; font-family: Verdana; font-size: 6pt;'>" + ldr(0).Item("cperapellido").ToString + " - " + ldr(0).Item("cuniorgnombre").ToString + "</span></td></tr>")
                DivPrincipal.Append("           <tr><td style='font-size:8px;text-align:left'><span style='font-weight: 700; color: #1A6696; font-family: Verdana; font-size: 6pt;'>Ciclo: </span><span style='color: #1A6696; font-family: Verdana; font-size: 6pt;'>" + ldr(0).Item("ciclo").ToString + "</span> - <span style='font-weight: 700; color: #1A6696; font-family: Verdana; font-size: 6pt;'>Cód. Univ: </span><span style='color: #1A6696; font-family: Verdana; font-size: 6pt;'>" + ldr(0).Item("coduniv").ToString + "</span></td></tr>")
                DivPrincipal.Append("       </table>")
                DivPrincipal.Append("   </td>")
                DivPrincipal.Append("   <td style='font-size:8px;'><a href='./PA_Alumno.aspx?cPerCodigo=" + LTrim(RTrim(ldr(0).Item("cPerCodigo").ToString)) + "'><img src='../Imagenes/Select_Btn_Big.png' weight='25px' height='25px' border='0'/></a></td>")
                DivPrincipal.Append("</tr>")
            End While
        End Using

        DivPrincipal.Append("</table>")
        lblParientes.Text = DivPrincipal.ToString
    End Sub
End Class
